/*
 * commons is a based project implemented
 * Copyright (C) 2024 Jasmine
 */
package com.commons.database.fill;

import java.time.LocalDateTime;

import org.apache.ibatis.reflection.MetaObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;

/**
 * 自动填充 创建时间和更新时间
 *
 * @author Jasmine
 * @version 1.0
 * @description
 * @date 2023-05-18 15:27:27
 * @see FileUpdateTimeMetaObjectHandler
 * @since JDK1.8
 */
@Component
public class FileUpdateTimeMetaObjectHandler implements MetaObjectHandler {
    private Logger log = LoggerFactory.getLogger(FileUpdateTimeMetaObjectHandler.class);

    @Override
    public void insertFill(MetaObject metaObject) {
        // this.strictInsertFill(metaObject, "createTime", LocalDateTime.class, LocalDateTime.now());
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        this.strictUpdateFill(metaObject, "updateTime", LocalDateTime.class, LocalDateTime.now());
    }
}
